Skip to content

Add Kotlin snippets for ten User Guide sections#5590

Merged
marcphilipp merged 5 commits intojunit-team:mainfrom
yalishevant:kotlin-snippets-batch3
Apr 23, 2026
Merged

Add Kotlin snippets for ten User Guide sections#5590
marcphilipp merged 5 commits intojunit-team:mainfrom
yalishevant:kotlin-snippets-batch3

Conversation

@yalishevant
Copy link
Copy Markdown
Contributor

@yalishevant yalishevant commented Apr 9, 2026

Adds Kotlin tabbed code snippets to ten more User Guide sections,
continuing the effort started in #5316 and #5432.

Pages updated (Writing Tests):

  • Built-in Extensions (@tempdir, @autoclose, Locale/TimeZone, SystemProperty)
  • Conditional Test Execution
  • Display Names
  • Annotations
  • Timeouts
  • Test Interfaces and Default Methods

Pages updated (Extensions):

  • Parameter Resolution
  • Keeping State in Extensions
  • Test Lifecycle Callbacks
  • Registering Extensions

I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

  • There are no TODOs left in the code
  • Method preconditions are checked (N/A — documentation only)
  • Coding conventions have been followed
  • Change is covered by automated tests
  • Public API has Javadoc and @API annotations (N/A — documentation only)
  • Change is documented in the User Guide

Add tabbed Java/Kotlin code examples to ten documentation pages,
continuing the effort started in junit-team#5316 and junit-team#5432.

Pages updated (Writing Tests):
- Built-in Extensions (@tempdir, @autoclose, Locale/TimeZone, SystemProperty)
- Conditional Test Execution
- Display Names
- Annotations
- Timeouts
- Test Interfaces and Default Methods

Pages updated (Extensions):
- Parameter Resolution
- Keeping State in Extensions
- Test Lifecycle Callbacks
- Registering Extensions

Signed-off-by: Anton.Yalyshev <yalishev.ant@gmail.com>
@yalishevant yalishevant force-pushed the kotlin-snippets-batch3 branch from 8a1b05b to 6128746 Compare April 9, 2026 18:50
@marcphilipp marcphilipp added this to the 6.1.0-M2 milestone Apr 10, 2026
@marcphilipp marcphilipp self-requested a review April 10, 2026 06:56
Copy link
Copy Markdown
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! 👍

Comment thread documentation/src/test/kotlin/example/kotlin/SystemPropertyExtensionDemo.kt Outdated
Comment thread documentation/src/test/kotlin/example/kotlin/SystemPropertyExtensionDemo.kt Outdated
Comment thread documentation/src/test/kotlin/example/kotlin/SystemPropertyExtensionDemo.kt Outdated
Comment thread documentation/modules/ROOT/pages/writing-tests/display-names.adoc
Comment thread documentation/src/test/kotlin/example/kotlin/TimeoutDemo.kt
Comment thread documentation/src/test/kotlin/example/kotlin/HttpServerDemo.kt Outdated
Comment thread documentation/src/test/kotlin/example/kotlin/timing/TimingExtension.kt Outdated
@yalishevant yalishevant force-pushed the kotlin-snippets-batch3 branch from 529d18f to 6128746 Compare April 16, 2026 13:53
- Include @nested, @testinstance, @tag in tag scope
- Add Kotlin tab for inline MyResource snippet in TIP block
- Add @JvmField on @RegisterExtension instance field
- Move logger to companion object in TimingExtension
- Remove unnecessary companion object from sendRequest
- Add Kotlin-only TIP for backtick test names in display-names

Signed-off-by: Anton.Yalyshev <yalishev.ant@gmail.com>
@yalishevant yalishevant requested a review from marcphilipp April 16, 2026 14:43
@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented Apr 23, 2026

✅ All tests passed ✅

🏷️ Commit: 84333b1
▶️ Tests: 8304 executed
⚪️ Checks: 15/15 completed


Learn more about TestLens at testlens.app.

@marcphilipp marcphilipp merged commit 5b48931 into junit-team:main Apr 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants